import request from "../../utils/request";
import {
  AnchorAlbumType,
  detailHeadetType,
  ResponseAlbumTrackRecord,
  ResponseCommonents,
  ResponseGuess,
  ResponseUserInfo,
} from "./type";

export const reqDetailPage = (id: number) => {
  return request.get<any, detailHeadetType>(
    `/m-revision/page/album/v2/queryAlbumPage/${id}`
  );
};

export const reqAlbumTrackRecord = (id: number) => {
  return request.get<any, ResponseAlbumTrackRecord>(
    `https://m.ximalaya.com/m-revision/common/album/queryAlbumTrackRecordsByPage?albumId=${id}&page=1&pageSize=10&asc=true&countKeys=play%2Ccomment&v=1692018651710`
  );
};

export const reqCommonentsData = (id: number) => {
  return request.get<any, ResponseCommonents>(
    `https://m.ximalaya.com/m-revision/common/album/queryAlbumCommentsByPage?page=1&pageSize=10&albumId=${id}&v=1692064693595`
  );
};

export const reqUserCountInfo = (anchorId: number) => {
  return request.get<any, ResponseUserInfo>(
    `https://m.ximalaya.com/m-revision/common/user/queryUserInfo/${anchorId}?userCountKeys=follower`
  );
};

export const reqAnchorAlbumInfo=(anchorId:number)=>{
  return request.get<any,AnchorAlbumType>(`/m-revision/common/anchor/queryAnchorAlbumsByPage?anchorId=${anchorId}&page=1&pageSize=3&asc=false`)
};


export const reqGuess=()=>{
  return request.get<any,ResponseGuess>(`/revision/category/v2/albums?pageNum=1&pageSize=5&sort=1`)
}